﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability.Infrastructure.Migrations
{
    public partial class ks : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BreedingEnterprises",
                columns: table => new
                {
                    Breeding_Enterprise_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Farm_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Inventory_Quantity = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BreedingEnterprises", x => x.Breeding_Enterprise_ID);
                });

            migrationBuilder.CreateTable(
                name: "BreedingModel",
                columns: table => new
                {
                    Breed_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Variety_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Feeding_Days = table.Column<int>(type: "int", nullable: false),
                    Feed_Brand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Breeding_Manager = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Date_of_Slaughter = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BreedingModel", x => x.Breed_ID);
                });

            migrationBuilder.CreateTable(
                name: "DeepEnterprisess",
                columns: table => new
                {
                    Deep_Processing_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Corporate_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Company_Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeepEnterprisess", x => x.Deep_Processing_ID);
                });

            migrationBuilder.CreateTable(
                name: "DeepProcessing",
                columns: table => new
                {
                    Supplier_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Teams_And_Groups = table.Column<int>(type: "int", nullable: false),
                    Person_In_Charge = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Supplier_Type = table.Column<int>(type: "int", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeepProcessing", x => x.Supplier_ID);
                });

            migrationBuilder.CreateTable(
                name: "GoodsModel",
                columns: table => new
                {
                    Goods_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Goods_Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GoodsModel", x => x.Goods_ID);
                });

            migrationBuilder.CreateTable(
                name: "HealthModel",
                columns: table => new
                {
                    Health_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Feeding_days = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Health_Care_Methods = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Health_Methods = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_HealthModel", x => x.Health_ID);
                });

            migrationBuilder.CreateTable(
                name: "PictureModel",
                columns: table => new
                {
                    Picture_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Image_Type = table.Column<int>(type: "int", nullable: false),
                    Image_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Image_Path = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PictureModel", x => x.Picture_ID);
                });

            migrationBuilder.CreateTable(
                name: "SlaughteringEnterprises",
                columns: table => new
                {
                    Slaughter_Enterprises_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Corporate_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Economize = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Market = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    County = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Detailed_Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Establishment_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Company_Profile = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughteringEnterprises", x => x.Slaughter_Enterprises_ID);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterModel",
                columns: table => new
                {
                    Slaughter_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Average_Weight = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Arrival_Time_At_the_factory = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Slaughter_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterModel", x => x.Slaughter_ID);
                });

            migrationBuilder.CreateTable(
                name: "TraceabilityModel",
                columns: table => new
                {
                    Traceability_ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Product_Name = table.Column<int>(type: "int", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Quality_Guarantee_Period = table.Column<int>(type: "int", nullable: false),
                    Production_License_Number = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Manufacturing_Enterprise = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Cover_Image = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Delete_Identifier = table.Column<bool>(type: "bit", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Information_Completeness = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TraceabilityModel", x => x.Traceability_ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BreedingEnterprises");

            migrationBuilder.DropTable(
                name: "BreedingModel");

            migrationBuilder.DropTable(
                name: "DeepEnterprisess");

            migrationBuilder.DropTable(
                name: "DeepProcessing");

            migrationBuilder.DropTable(
                name: "GoodsModel");

            migrationBuilder.DropTable(
                name: "HealthModel");

            migrationBuilder.DropTable(
                name: "PictureModel");

            migrationBuilder.DropTable(
                name: "SlaughteringEnterprises");

            migrationBuilder.DropTable(
                name: "SlaughterModel");

            migrationBuilder.DropTable(
                name: "TraceabilityModel");
        }
    }
}
